main: Add --link-checkout-speedup option to commit
authorColin Walters <walters@verbum.org>
Wed, 17 Jul 2013 20:16:45 +0000 (16:16 -0400)
committerColin Walters <walters@verbum.org>
Wed, 17 Jul 2013 23:20:53 +0000 (19:20 -0400)
And disable devino scan by default.  For the gnome-ostree build case,
our commits are from "make install DESTDIR=", so they won't be
hardlinks into the repo.  In that case, particularly as the repository
size grows, the cost of building up the devino -> checksum mapping
becomes a problem.

The compose step will use this option though.

src/ostree/ot-builtin-commit.c

index 58797ccc4e2ad360b133e71b773b21b24a101c0b..f4af1b4031958438bdd86277ec2e91a960d0a4c3 100644 (file)
@@ -34,6 +34,7 @@ static char *branch;
 static char **metadata_strings;
 static char *statoverride_file;
 static char *opt_related_objects_file;
+static gboolean opt_link_checkout_speedup;
 static gboolean skip_if_unchanged;
 static gboolean tar_autocreate_parents;
 static gboolean no_xattrs;
@@ -53,6 +54,7 @@ static GOptionEntry options[] = {
   { "owner-uid", 0, 0, G_OPTION_ARG_INT, &owner_uid, "Set file ownership user id", "UID" },
   { "owner-gid", 0, 0, G_OPTION_ARG_INT, &owner_gid, "Set file ownership group id", "GID" },
   { "no-xattrs", 0, 0, G_OPTION_ARG_NONE, &no_xattrs, "Do not import extended attributes", NULL },
+  { "link-checkout-speedup", 0, 0, G_OPTION_ARG_NONE, &opt_link_checkout_speedup, "Optimize for commits of trees composed of hardlinks into the repository", NULL },
   { "tar-autocreate-parents", 0, 0, G_OPTION_ARG_NONE, &tar_autocreate_parents, "When loading tar archives, automatically create parent directories as needed", NULL },
   { "skip-if-unchanged", 0, 0, G_OPTION_ARG_NONE, &skip_if_unchanged, "If the contents are unchanged from previous commit, do nothing", NULL },
   { "statoverride", 0, 0, G_OPTION_ARG_FILENAME, &statoverride_file, "File containing list of modifications to make to permissions", "path" },
@@ -346,7 +348,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GCancellable *ca
         goto out;
     }
 
-  if (!ostree_repo_prepare_transaction (repo, TRUE, NULL, cancellable, error))
+  if (!ostree_repo_prepare_transaction (repo, opt_link_checkout_speedup, NULL, cancellable, error))
     goto out;
 
   in_transaction = TRUE;